<div id="message">Als u een overzicht heeft ontvangen van uw schuldeiser, kunt u dit hieronder invullen</div>
<form method="post" action="{{self.request.path}}" class="client-debts-form collector">
    <p>
        Schuld bij: <strong>{{ creditor.creditor.display_name }}</strong><br>
        <label>Deze schuld hoort bij een andere instantie:</label>
		{% if not selected %}
		<a href="/client/debts/creditor/select?is_collector={{creditor.creditor.is_collector|yesno:"False,True"}}&come_from={{creditor.key.id}}" target="_popup">{{debt.creditor_or_collector}}Ja</a><br>
		{% else %}
		<a href="/client/debts/creditor/select?is_collector={{creditor.creditor.is_collector|yesno:"False,True"}}&come_from={{creditor.key.id}}" target="_popup">{{selected.display_name}}</a><br>
		{% endif %}
        <input type="hidden" name="selected" value="{{selected.key.id}}">
        <label>Openstaand bedrag</label>{{form.amount}} {{form.amount.errors}}<br>
        <label>Datum brief</label>{{form.response_date}}<br>
        <label>Dossiernummer Deurwaarder</label>{{form.collector_dossier_number}}<br>
        <label>Dossiernummer Schuldeiser</label>{{form.creditor_dossier_number}}<br>
        <label>Afbetalingsregeling</label>{{form.payment_amount}}
    </p>
    <p class="submit">
        <input type="submit" value="&gt;&gt;&gt; Toevoegen aan dossier" class="app-control">
    </p>

</form>
<div class="debts-listing">
    <table>
        <tr>
            <th>Schuldeiser</th>
            <th>Openstaand bedrag</th>
            <th>Datum brief</th>
            <th>Dossiernummer Deurwaarder</th>
            <th>Dossiernummer Schuldeiser</th>
            <th>Afbetalingsregeling</th>
        </tr>
{% for debt in creditor.debts %}
        <tr>
            <td>{{debt.collected_for.display_name|default:"--"}}</td>
            <td class="amount">&euro; {{debt.amount}}</td>
            <td class="date">{{debt.response_date|date:"d-m-Y"}}</td>
            <td class="dossier">{{debt.collector_dossier_number}}</td>
            <td class="dossier">{{debt.creditor_dossier_number}}</td>
            <td class="amount">&euro; {{debt.payment_amount}}</td>
        </tr>
{% endfor %}
    </table>
</div>







{% comment %}
<form method="post" action="{{self.request.path}}" class="client-debts-form">
{% if self.user.class_name == 'Client' %}
<a href="/client/debts">[&lt;]</a>
{% else %}
<a href="/employee/cases/view/{{creditor.user.key}}">[&lt;]</a>
{% endif %}

{{ creditor.creditor.display_name }}
<input type="hidden" name="creditor" value="{{creditor.key.id}}">
<table>
 <tr><th>Oorspronkelijke schuldeiser</th><th>Ontstaansdatum</th><th>Dossiernummer Deurwaarder</th><th>Dossiernummer Schuldeiser</th><th>Openstaand bedrag</th><th>Afbetalingsregeling</th>
 </tr>
{% for debt in creditor.debts %}
 <tr>
		  <td>{{debt.collected_for.display_name}}</td>
		  <td class="date">{{debt.original_date|date:"d-m-Y"}}</td>
		  <td class="dossier">{{debt.collector_dossier_number}}</td>
		  <td class="dossier">{{debt.creditor_dossier_number}}</td>
		  <td class="amount">{{debt.amount}}</td>
		  <td class="amount">{{debt.payment_amount}}</td>
 </tr>
{% endfor %}
  <tr>
	<td colspan="0">
	   {% if form.non_field_errors %}
		  {{ form.non_field_errors }}<br>
	   {% endif %}
	   {% for field in form %}
		  {{ field.errors }}
	   {% endfor %}
	<td>
  </tr>
  <tr>
	{% if not selected %}
	<td><a href="/client/debts/creditor/select?is_collector={{creditor.creditor.is_collector}}&come_from={{creditor.key.id}}" target="_popup">{{debt.creditor_or_collector}}Klik me</a></td>
	{% else %}
	<td><a href="/client/debts/creditor/select?is_collector={{creditor.creditor.is_collector}}&come_from={{creditor.key.id}}" target="_popup">{{selected.display_name}}</a></td>
	{% endif %}
	<input type="hidden" name="selected" value="{{selected.key.id}}">
	<td>{{form.original_date}}</td>
	<td>{{form.collector_dossier_number}}</td>
	<td>{{form.creditor_dossier_number}}</td>
	<td>{{form.amount}}</td>
	<td>{{form.payment_amount}}</td>
 </tr>
 <tr><td colspan="0"><input type="submit" value="Opslaan"></td></tr>
</table>
</form>
{% endcomment %}
